import http from '@/axios';

//统一接口信息
//所有的请求全部统一在这里配置
//get请求示例,带参数
export const getUserInfo = (param) => http.get('url',param.id);
//get请求示例，不带参数
export const getUserList = () => http.get('url');
//post请求示例 带参数
export const validateLoginApi = (data) => http.post('url',data);
//post请求示例 不带参数
export const userlogout = () => http.post('url');
//建议使用的方法
//将post对象封装在一个form对象里，直接将对象作为参数传入
export const doMothed = (form) => http.post('url',form);

/**
 * 用户相关请求API
 */
export const validateLogin = (data) => http.post('/user/validateLogin', data);

/**
 * 秒杀活动相关请求API
 */


/**
 * 商品相关请求API
 */
// 商品图片上传
export const uploadProductImage = (data) => http.postFile('/product/upload', data)
// 添加商品
export const addProduct = (data) => http.post('/product/add', data);
// 更新商品
export const updateProduct = (data) => http.post('/product/edit', data);
// 删除商品
export const deleteProduct = (data) => http.post('/product/delete', data);
// 获取商品列表
export const getProductPagerList = (data) => http.post('/product/pagerlist', data);

/**
 * 商品分类管理API
 */
export const getProductCategoryList = () => http.get('/classes/list');
export const addProductCategory = (data) => http.post('/classes/add', data);
export const updateProductCategory = (data) => http.post('/classes/update', data);
export const deleteProductCategory = (data) => http.post('/classes/delete', data);